package com.taxsearch.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 旅馆请求token链接
 */
@Component(value = "spring.datasource.primary")
@ConfigurationProperties(prefix = "spring.datasource.primary")
public class DataBaseParam {
    /**
     * 请求链接
     */
    private static String url;

    /**
     * 数据库用户名
     */
    private static String username;

    /**
     * 数据库密码
     */
    private static String password;

    /**
     * 数据库驱动名
     */
    private static String driverClassName;

    public static String getUrl() {
        return url;
    }

    @Value("${spring.datasource.primary.url}")
    public void setUrl(String url) {
        DataBaseParam.url = url;
    }

    public static String getUsername() {
        return username;
    }

    @Value("${spring.datasource.primary.username}")
    public void setUsername(String username) {
        DataBaseParam.username = username;
    }

    public static String getPassword() {
        return password;
    }

    @Value("${spring.datasource.primary.password}")
    public void setPassword(String password) {
        DataBaseParam.password = password;
    }

    public static String getDriverClassName() {
        return driverClassName;
    }

    @Value("${spring.datasource.primary.driver-class-name}")
    public void setDriverClassName(String driverClassName) {
        DataBaseParam.driverClassName = driverClassName;
    }
}
